#include "cpu/exec/template-start.h"

#define make_jcc_helper(cc, type) \
    make_helper(concat6(j, cc, _, type, _, SUFFIX)) { \
        int len = concat(decode_si_, SUFFIX) (eip + 1); \
        print_asm("j" str(cc) " %x", (int)(eip + 1 + len + op_src->val)); \
        cpu.eip += concat(check_cc_, cc)() ? op_src->val : 0; \
        return len + 1; \
    }

make_jcc_helper(a, si)
make_jcc_helper(b, si)
make_jcc_helper(e, si)
make_jcc_helper(ne, si)
make_jcc_helper(le, si)
make_jcc_helper(be, si)
make_jcc_helper(g, si)
make_jcc_helper(ge, si)
make_jcc_helper(l, si)
make_jcc_helper(s, si)
make_jcc_helper(ns, si)

#include "cpu/exec/template-end.h"